package cn.tedu.boot04.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BmiController {
    @RequestMapping("/bmi")
    public String bmi(double h,double w){
        double bmi=w/(h*h);
        if (bmi<18.5){
            return "偏瘦"+bmi;
        }
        if(bmi<24){
            return "正常"+bmi;
        }
        if(bmi<28){
            return "偏胖"+bmi;
        }
        return "太胖"+bmi;
    }
}
